<template>
  <div class="content">我是首页</div>
  <el-row :gutter="12" style="margin-top: 20px">
    <el-col :sm="8" :xs="24" class="card">
      <el-card shadow="always">
        总销售额：
        <div v-countRun="99999" :step="step" class="price" style="color: red">
          0
        </div>
        <div class="unit">元</div></el-card
      >
    </el-col>
    <el-col :sm="8" :xs="24" class="card">
      <el-card shadow="hover">
        成本：
        <div
          v-countRun="47258"
          :step="step"
          class="price"
          style="color: orange"
        >
          0
        </div>
        <div class="unit">元</div></el-card
      >
    </el-col>
    <el-col :sm="8" :xs="24" class="card">
      <el-card shadow="never">
        利润：
        <div
          v-countRun="99999 - 47258"
          :step="step"
          class="price"
          style="color: blue"
        >
          0
        </div>
        <div class="unit">元</div></el-card
      >
    </el-col>
  </el-row>
</template>

<script setup lang="ts">
import { ref } from "vue";
const step = ref(100);
</script>

<style scoped lang="scss">
.content {
  width: 100%;
  height: 60px;
  line-height: 60px;
  background: #ededed;
}
.price {
  font-size: 45px;
  font-weight: 600;
}
.unit {
  font-size: 12px;
  color: #ccc;
}

.card {
  transition: all 0.3s;
}

@media screen and (max-width: 768px) {
  .card {
    margin-bottom: 20px;
  }
}
</style>
